1 <?php
2 include(
"header.php");
3 include(
"sidebar.php");
4 include(
"dbconnection.php");
5 ?>
6 <script type=
"text/javascript">
7 function validate()
8 {

9 if
(document.form1.billno.value=="")
10 {
11     alert(
"Enter the Billing Number");
12     document.form1.billno.focus();
13     
return false;
14 }

15 if
(document.form1.servid.value=="")
16 {
17     alert(
"Enter the Service ID");
18     document.form1.servid.focus();
19     
return false;
20 }

21 if
(document.form1.particulars.value=="")
22 {
23     alert(
"Enter the Particulars");
24     document.form1.particulars.focus();
25     
return false;
26 }

27 if
(document.form1.scost.value=="")
28 {
29     alert(
"Enter the scost");
30     document.form1.scost.focus();
31     
return false;
32 }

33 if
(document.form1.paidst.value=="")
34 {
35     alert(
"Enter the paid status");
36     document.form1.paidst.focus();
37     
return false;
38 }
39 }
40 </script>
41 <?php
42 $dt= date(
"Y-m-d");
43 if
(isset($_POST["submit"]))
44 {
45
46 $sql =
"insert into billing(billingno,serviceid,particulars,scost,date,paidstatus) values('$_POST[billno]','$_POST[servid]','$_POST[particulars]','$_POST[scost]','$_POST[date]','$_POST[paidst]')";
47 if
(!mysql_query($sql,$con))
48   {
49   die(
'Error: ' . mysql_error());
50   }
51 $ctins = mysql_affected_rows();
52 }
53 ?>
54         
55                             
56         <div id=
"main">
57             
58             <a name=
"TemplateInfo"></a>
59             <h1>Billing</h1>
60
61 <?php

62 if
($ctins == 1)
63 {
64     echo
"<center><b>Custmer registered Successfully...</b></center><br>";
65     echo
"<center><b><a href='login.php'>Click here to Login.</a></b></center>";
66 }

67 else

68 {
69     ?>
70         <form id=
"form1" name="form1" method="post" action="" onsubmit="return valiadate()">
71             <table width=
"427" border="0">
72               <tr>
73                 <th width=
"170" height="33" scope="row">Billing Number</th>
74                 <td width=
"247">
75                   <label
for="billno"></label>
76                   <input type=
"text" name="billno" id="billno" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/>
77                 </td>
78               </tr>
79               <tr>
80                 <th height=
"37" scope="row">Service Id
81                   <label
for="servid"></label></th>
82                 <td><input type=
"text" name="servid" id="servid" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/></td>
83               </tr>
84               <tr>
85                 <th height=
"36" scope="row">Particulars</th>
86                 <td><label
for="particulars"></label>
87                 <input type=
"text" name="particulars" id="particulars" /></td>
88               </tr>
89               <tr>
90                 <th height=
"34" scope="row">Scost</th>
91                 <td><label
for="scost"></label>
92                 <input type=
"text" name="scost" id="scost" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/></td>
93               </tr>
94               <tr>
95                 <th height=
"37" scope="row">Date</th>
96                 <td><label
for="date"></label>
97                   <label
for="date"></label>
98                 <input type=
"text" name="date" id="date" value="<?php echo $dt; ?>" readonly/></td>
99               </tr>
100               <tr>
101                 <th height=
"37" scope="row">Paid Status</th>
102                 <td><label
for="date"></label>
103                 <input type=
"text" name="paidst" id="paidst" /></td>
104               </tr>
105               <tr>
106                 <th scope=
"row">&nbsp;</th>
107                 <td><br /> <input type=
"submit" name="submit" id="submit" value="Register" /></td>
108               </tr>
109           </table>
110       </form>
111       <?php
112 }
113 ?>
114             <p>&nbsp;</p>
115 <br />
116                                             
117         </div>
118         
119 <!-- wrap ends here -->
120 </div>
121         
122 <?php
123 include(
"footer.php");
124 ?>


Gõ tìm kiếm nhanh...